#pragma once


#include <string>
#include "DXUtil.h"
#include "resource.h"

class Editor
{
public:
	//Constructor
	Editor(HINSTANCE hInstance);
	//Destructor
	~Editor(void);

	//Main application loop
	int Run();

	//Framework methods
	virtual bool Init();
	virtual void Update(float dt) = 0;
	virtual void Render() = 0;
	virtual LRESULT MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) = 0;

protected:

	HWND			m_hEditorWindow;
	HINSTANCE		m_hEditorInstance;
	UINT			m_EditorWidth;
	UINT			m_EditorHeight;
	std::string		m_sEditorTitle;
	DWORD			m_EditorStyle;

	WNDCLASSEX		borderClass;
	HWND mapEditorControl;
	HWND statusControl;
	HWND borderControls[3];
	HWND textureViewControl;



	ID3D11Device*					m_pDevice;
	ID3D11DeviceContext*			m_pDeviceContext;
	ID3D11RenderTargetView*		m_pRenderTargetView;
	ID3D11DepthStencilView*		m_pDepthStencilView;
	IDXGISwapChain*				m_pSwapChain;
	D3D_FEATURE_LEVEL				m_FeatureLevel;
	D3D_DRIVER_TYPE				m_DriverType;
	D3D11_VIEWPORT				m_Viewport;

private:

	bool InitWindow();
	//Init Direct3D
	bool InitDirect3D();
	void CalculateFPS(float dt);
};

